#define _CRT_SECURE_NO_WARNINGS 1
#include <math.h>
#include <stdio.h>
int judge(int num)
{
    int sum = 0;
    for (int i = 2; i < sqrt(num); i++)
    {
        if (num % i == 0)
        {
            sum += i;
            sum += (num / i);
        }
    }
    if ((sum + 1) == num)
        return 1;
    else
        return 0;
}
int main() {
    int count = 0, n;
    scanf("%d", &n);
    for (int i = 2; i <= n; i++)
    {
        int temp = judge(i);
        if (temp == 1)
            count++;
    }
    printf("%d", count);
    return 0;
}